home *** CD-ROM | disk | FTP | other *** search
- Path: mail2news.demon.co.uk!beachyhd.demon.co.uk
- From: Adam@beachyhd.demon.co.uk
- Newsgroups: comp.sys.amiga.programmer
- Subject: "Fuzzy" string searching
- Date: 10 Feb 96 13:56:14 GMT
- Organization: Beachy Head - UK
- Message-ID: <311cf85e@beachyhd.demon.co.uk>
- X-NNTP-Posting-Host: beachyhd.demon.co.uk
- MIME-Version: 1.0
- Content-Type: text/plain; charset=iso-8859-1
- Content-Transfer-Encoding: 8bit
- X-GateSoftware: AmiGate 1.6 (13.11.95)
- MMDF-Warning: Parse error in original version of preceding line at relay-4.mail.demon.net
- X-Mail2News-Path: relay-4.mail.demon.net!post.demon.co.uk!beachyhd.demon.co.uk
-
- Hi all,
-
- I wish to write a function that will perform a 'fuzzy' search for one string
- within another.
-
- The most simple level of search is to just check if the 'search' string is in
- the 'source' string. So if I'm searching for 'test' in the string 'this is a
- test', it will obviously be found.
-
- But I need to go further than that, and provide more intelligent searching. If
- I search for the word 'recent' in the string 'currency/recency', I still want a
- very close match to be indicated.
-
- This becomes more difficult when searching (for example) for the word
- 'workload' in the string 'high work-load'. Never more than 4 characters match
- at any time, though obviously this should provide a very close match.
-
- The idea is similar to that used in spell-checkers.. When the program doesn't
- recognise your word, it manages to search its dictionary for things it thinks
- are very close.
-
- Does anyone have any suggestions or code that might allow me to perform this
- sort of search? Ideally a function that I pass two strings to, and which
- returns a score value within a given range (say, 0 to 100)..?
-
- Thanks in advance,
-
- .\dam. [Team AMIGA] //\ ad32@brighton.ac.uk \\/
-
-